#include	"Message.hpp"
#include	"../IStream/Stream.hpp"

using namespace zia;
using namespace std;


zia::Message::Message(api::IConnection& connection) : IMessage(connection)
{

}

zia::Message::~Message()
{

}

api::AStream *		zia::Message::newDataStream()
{
	api::AStream *	ret = NULL;

	ret = new api::Stream;
	return (ret);
}

api::AStream *		zia::Message::newResourceStream(api::Resource resource,
						api::ResourceType type /*= api::RCE_SOCKET*/,
						api::FdCallback readingCallback /*= api::FdCallback()*/,
						api::FdCallback writingCallback /*= api::FdCallback()*/)
{
	api::AStream *	ret = NULL;

	resource = (zia::api::Resource)type;
	readingCallback = writingCallback;
	return (ret);
}

void				zia::Message::forceDeleteStream(api::AStream* stream)
{
	delete stream;
	return ;
}

api::IMessage*		Message::newMessageAtStep(api::HttpStepID stepId, api::AStream& input)
{
	api::IMessage*	ret = NULL;
	stepId = stepId;
	input = input;
	return (ret);
}

void				zia::Message::setBody(const std::string &val)
{
	this->_body = val;
	return ;
}
